package io.renren.enums;

import java.util.ArrayList;
import java.util.List;

public enum SamplerNameEnum {
    //DPM++ 2M、DPM++ SDE、DPM++ 2M SDE、DPM++ 2M SDE Heun、DPM++ 2S a、DPM++ 3M SDE、Eular a、Eular、LMS、Heun、DPM2、DPM2 a、DPM fast、DPM adaptive、Restart、DDIM、PLMS、UniPC、LCM
    DPM_2_M("DPM++ 2M"),
    DPM_2_SDE("DPM++ SDE"),
    DPM_2_M_SDE("DPM++ 2M SDE"),
    DPM_2_M_SDE_HEUN("DPM++ 2M SDE Heun"),
    DPM_2s_A("DPM++ 2S a"),
    DPM_3_M_SDE("DPM++ 3M SDE"),
    EULER_A("Eular a"),
    EULER("Eular"),
    LMS("LMS"),
    HEUN("Heun"),
    DPM_2("DPM2"),
    DPM_2_A("DPM2 a"),
    DPM_FAST("DPM fast"),
    DPM_ADAPTIVE("DPM adaptive"),
    RESTART("Restart"),
    DDIM("DDIM"),
    PLMS("PLMS"),
    UNIPC("UniPC"),
    LCM("LCM");

    private String name;

    SamplerNameEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static SamplerNameEnum getEnumByName(String name) {
        for (SamplerNameEnum samplerNameEnum : SamplerNameEnum.values()) {
            if (samplerNameEnum.getName().equals(name)) {
                return samplerNameEnum;
            }
        }
        return null;
    }

    public static String getNameByEnum(SamplerNameEnum samplerNameEnum) {
        return samplerNameEnum.getName();
    }

    public static List<String> getAllName() {
        List<String> names = new ArrayList<>();
        for (SamplerNameEnum samplerNameEnum : SamplerNameEnum.values()) {
            names.add(samplerNameEnum.getName());
        }
        return names;
    }
}
